#include "A.h"

#define eps 0.0001
#define M 1000

class Fun1 : public Fun
{
public:
	double f(double x)
	{
		return 10*(0.5*PI-asin(x)-x*sqrt(1-x*x))-12.4;
	}      
    double df(double x)
    {
        return -20*sqrt(1-x*x);
    }
};

double test1()
{
	Fun1 f1;
	Bisection s(f1, 0, 1, 0.01, eps, M);
	return 1-s.solve();
}

double test2()
{
	Fun1 f1;
	Newton s(f1, 0, eps, M);
	return 1-s.solve();
}

double test3()
{
	Fun1 f1;
	Secant s(f1, 0, 1, 0.01, eps, M);
	return 1-s.solve();
}

int main()
{
	printf("The solution by Bisection method is %f\n",test1());
	printf("The solution by Newton method is %f\n",test2());
	printf("The solution of Secant method is %f\n",test3());
}